import React, { Component } from 'react';
import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Spin, Card } from 'antd';
import moment from 'moment';
import DescriptionList from '@/components/DescriptionList';

const { Description } = DescriptionList;
class AddEmpNameInfor extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }

  render() {
    const { empSendInfoVo, empBaseInfoVo, loading } = this.props;
    if (!loading) {
      return (
        <div>
          <Card title={<span style={{ fontWeight: 'bolder' }}>派单信息</span>} bordered={false}>
            <DescriptionList style={{ marginBottom: 50}}>
              <Description term="签约方 ">
                {empSendInfoVo.ordSndrName ? empSendInfoVo.ordSndrName : '--'}
              </Description>
              <Description term="客户名称">
                {empSendInfoVo.custName ? empSendInfoVo.custName : '--'}
              </Description>
              <Description term="执行地">{empSendInfoVo.areaName || '--'}</Description>
              <Description term="派单时间">
                {empSendInfoVo.creTime
                  ? moment(empSendInfoVo.creTime).format('YYYY-MM-DD HH:mm')
                  : null}
              </Description>
              <Description term="所属客服">{empSendInfoVo.creName || '--'}</Description>
              <Description term="操作时间">
                {empSendInfoVo.operTime
                  ? moment(empSendInfoVo.operTime).format('YYYY-MM-DD HH:mm')
                  : '--'}
              </Description>
            </DescriptionList>
          </Card>
          <Card title={<span style={{ fontWeight: 'bolder' }}>基本信息</span>} bordered={false}>
            {/* <h3>基本信息</h3> */}
            <DescriptionList style={{ marginBottom: 50 }}>
              <Description term="员工姓名">
                {empBaseInfoVo.empName ? empBaseInfoVo.empName : '--'}
              </Description>
              <Description term="证件类型">
                {empBaseInfoVo.idTypeName ? empBaseInfoVo.idTypeName : '--'}
              </Description>
              <Description term="证件号">
                {empBaseInfoVo.idCode ? empBaseInfoVo.idCode : '--'}
              </Description>
              <Description term="性别">
                {empBaseInfoVo.genderName ? empBaseInfoVo.genderName : '--'}
              </Description>
              <Description term="国籍">
                {empBaseInfoVo.nationName ? empBaseInfoVo.nationName : '--'}
              </Description>
              <Description term="出生日期">
                {empBaseInfoVo.birthDate
                  ? moment(empSendInfoVo.birthDate).format('YYYY-MM-DD')
                  : null}
              </Description>
              <Description term="电话">
                {empBaseInfoVo.mobile ? empBaseInfoVo.mobile : '--'}
              </Description>
              <Description term="员工邮箱">
                {empBaseInfoVo.email ? empBaseInfoVo.email : '--'}
              </Description>
            </DescriptionList>
          </Card>
        </div>
      );
    }
    return <Spin size="small" tip="Loading..." />;
  }
}

export default Form.create()(AddEmpNameInfor);
